package com.test.groovy

/**
 * ClosePage--GroovyTest
 *
 * @author: Jovi
 *
 * @createTime: 2018-06-11 14:25
 *
 * */
class ClosePage {
    static void main(String[] args) {

        coll()

        def excite = {
            world ->
                return "${world}!!"
        }

        println "Groovy!!" == excite("Groovy")
        println "Java!!" == excite.call("Java")

    }

    private static void coll() {
        def acoll = ["Groovy", "Java", "Ruby"]

        def printlns = {
            it -> println "haha$it"
        }

        acoll.forEach(printlns)

        acoll.each {
            println it
        }

        acoll.each {
            value ->
                println value
        }

        def hash = [name: "andy", "Vpn": 45]

        hash.each {
            println(it)
        }

        hash.each {
            key, value ->
                println "${key}:${value}"
        }
    }
}
